﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MyCustomerMasterList.aspx.cs" Inherits="YWTSSys.Web.MachineSys.YWTSWeb.yw.MyCustomerMasterList" %>
<%--业务员，我的客户列表--%>
<div class="pageContent" style="padding:5px;">		   
        <table width="100%" border="0" cellpadding="0" cellspacing="0" >
            <tr>                
                <td   valign="top"> 
                    <div layoutH="0" >                       
                        <div layoutH="220" style="border:solid 1px #CCC; border-bottom-width:0px!important; background:#fff"> 
		                    <div class="pageHeader" >
                                <form id="pagerForm" method="post" action="YWTSWeb/yw/MyCustomerMasterList.aspx" onsubmit="return navTabSearch(this);" >
                                    <input type="hidden" name="orderField" value="<%=orderField %>" />
                                    <input type="hidden" name="orderDirection" value="<%=orderDirection %>" />
                                    <input type="hidden" name="pageNum" value="1" />
                                    <input type="hidden" name="numPerPage" value="<%=numPerPage %>" />
    
                                    <div class="searchBar">
                                    <table class="searchContent">
                                        <tr>               
                                            <td>
                                                客户查找： 
                                            </td>
                                            <td>
                                               <input name="sqlvalue" type="text" value="<%=sqlvalue %>"  />
                                            </td>
                                            <td>
                                                 <div class="subBar">
                                                    <ul>
                                                        <li>
                                                            <div class="buttonActive"><div class="buttonContent"><button type="submit">检索</button></div></div>
                                                        </li>
                                                    </ul>
                                                </div>
                   
                                            </td>  
                                            <td>
                                                (<b style="color:Red;">未拔打电话</b>.<b style="color:green;">已拔打</b>.双击客户进行操作)
                                            </td>
                                        </tr>                                
                                    </table>       
                                    </div>
                                </form>
                            </div>
                            <div class="pageContent"  > 
                                <table class="table" width="100%"  layoutH="311">
                                    <thead>
                                        <tr  > 
                                            <th   <%=GetDataListOrder("客户名称") %>>客户名称</th>
                                            <th   <%=GetDataListOrder("手机号码") %>>手机号码</th>                
                                            <th width="90px"  <%=GetDataListOrder("生日") %>>生日</th> 
                                            <th width="80" align="center"  <%=GetDataListOrder("AreaTag") %>>地区</th>
                                            <th width="80" align="center"  <%=GetDataListOrder("分组标志") %>>分组</th>                                           
                                        </tr>
                                    </thead>                
                                    <asp:repeater id="rpMenu" runat="server">
                                        <HeaderTemplate>   
                                        <tbody>   
                                        </HeaderTemplate>
                                        <ItemTemplate>
                                            <tr  onclick="MyCustomerMasterList_ShowHistry(<%# Eval("客户ID")%>,<%# Convert.ToInt16( Eval("电话拔打状态")) %>)" style="color:<%# Convert.ToBoolean(Eval("电话拔打状态"))?"green":"red"%>" >                
				                                <td><%# Eval("客户名称")%></td>
				                                <td ><%# Eval("手机号码")%></td>
                                                <td>
                                                    <%# Eval("生日") is DBNull ? "" :Convert.ToDateTime(Eval("生日")).ToString("yyyy-MM-dd")%>                                        
                                                </td>
                                                <td><%# Eval("AreaTag")%></td>
                                                <td><%# Eval("分组标志")%></td>                                               
			                                </tr>
                                        </ItemTemplate>
                                        <FooterTemplate>
                                            </tbody>                         
                                        </FooterTemplate>
                                    </asp:repeater>
                                </table>   
                                <div class="panelBar">
                                    <div class="pages">
                                        <span>显示</span>
                                        <select class="combox" name="numPerPage" onchange="navTabPageBreak({numPerPage:this.value})">
                                           <%=SetnumPerPage() %>
                                        </select>
                                        <span>条，共<%=TotalCount%>条</span>
                                    </div>
                                    <div class="pagination" showPageNav="0" targettype="navTab" totalcount="<%=TotalCount%>" numperpage="<%=numPerPage %>"
                                        pagenumshown="10" currentpage="<%=pageNum %>">
                                    </div>
                                </div>                 
                            </div>
                        </div>
                        <div id="MyCustomerMasterList_CustomerTelConsumerRecord" style="height:200px; background:#fff; margin-top:5px;">
                            相关客户消费及电话列表
                        </div> 
                        <a  href="YWTSWeb/yw/CustomerTelConsumerRecordList.aspx?customerid=0" style="display:none;" target="ajax" rel="MyCustomerMasterList_CustomerTelConsumerRecord"  defautloadajax="true">相关客户消费及电话列表</a>
                    </div>   
                </td>
                <td valign="top"   style=" padding-left:5px;   background:#fff;width:300px;" >
                    <div layoutH="0"  >                        
                         <div  layoutH="320"  id="CustomerMasterList_TelRecordDetail" style=" border-width:1px ; border-style:solid; border-color: #CCC; line-height:21px; overflow:scroll; ">
                            查看通话明细
                         </div>
                         <a  href="YWTSWeb/yw/AddTelRecord.aspx?customerid==0" style="display:none;" target="ajax" rel="MyCustomerMasterList_TelRecordDetail"  defautloadajax="true">相关客户消费及电话列表</a>
                         <div id="MyCustomerMasterList_AddTelRecord" style="height:300px;border:solid 1px #CCC; background:#fff; margin-top:5px;">
                              本次通话记录
                         </div>
                    </div>
                                
                </td>
            </tr>
        </table>	
</div>

<script type="text/javascript" >
    function MyCustomerMasterList_ShowHistry(_customerId,_istel) {
        //alert(_customerId);
        //1.显示通话及消费记录
        var rel = "MyCustomerMasterList_CustomerTelConsumerRecord";
        var href = "YWTSWeb/yw/CustomerTelConsumerRecordList.aspx?customerid=" + _customerId;
        if (rel) {
            var $rel = $("#" + rel);
            $rel.loadUrl(href, {}, function () {
                $rel.find("[layoutH]").layoutH();
            });
        }
       
        //2.加载本次通话页
        rel = "MyCustomerMasterList_AddTelRecord";
        href = "YWTSWeb/yw/AddTelRecord.aspx?customerid=" + _customerId;
        if (rel) {
            var $rel = $("#" + rel);
            if (_istel) {
                $rel.html("已打过电话,无需再打.");
            } else {
                $rel.loadUrl(href, {}, function () {
                    $rel.find("[layoutH]").layoutH();
                });
            }
        }

        //3.显示通话及消费记录
        rel = "CustomerMasterList_TelRecordDetail";
        href = "YWTSWeb/yw/TelRecordDetail.aspx?telid=0";
        if (rel) {
            var $rel = $("#" + rel);
            $rel.loadUrl(href, {}, function () {
                $rel.find("[layoutH]").layoutH();
            });
        }
    }
</script>